<template>
  <div>
    <h1>Parent ---{{count}}</h1>
    <button @click='myClick'>点击</button>
    <!-- <Child @changeCount = 'changeCount'/> -->
    <Child @changeCount='count += $event' />
    <!-- 自定义事件 -->
    <Child @click='click1' />
    <!-- 原生DOM事件 -->
    <Child @click.native='click1'/>
  </div>
</template>

<script>
import Child from "./Child";
export default {
  name: "Parent",
  components: {
    Child,
  },
  data(){
    return {
      count:0
    }
  },
  methods:{
    myClick($event){
      console.log($event);
    },
    // changeCount($event){
    //   console.log($event);
    //   this.count += $event
    // },
    click1(){
      console.log('click1');
    }
  }
};
</script>

<style>
</style>